package com.qd.common.panda.domain.entity.wallet.user;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 用户钱包充值
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class UserWalletRechargeDTO extends BaseQuery {
    /**
     * 用户ID
     */
    @JsonIgnore
    private String userId;
    /**
     * 充值金额
     */
    private String rechargeAmount;
    /**
     * 套餐发布ID
     */
    @NotBlank(message = "套餐发布ID不能为空", groups = DeleteGroup.class)
    @Size(max = 50, message = "套餐发布ID长度不能超过{max}位", groups = DeleteGroup.class)
    private String publishId;
    /**
     * 套餐编码
     */
    @NotBlank(message = "套餐编码不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "套餐编码长度不能超过{max}位", groups = DefaultGroup.class)
    private String planCode;

    @Override
    public void freeData() {
        this.rechargeAmount = null;
        this.publishId = null;
        this.planCode = null;
        this.userId = null;
    }
}
